package top.zsyle.sycc.fallback;


import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;
import top.zsyle.sycc.exception.GlobalExceptionEnum;
import top.zsyle.sycc.feign.CourseMarketService;
import top.zsyle.sycc.result.JsonResult;

@Component
public class CourseMarketFallbackFactory implements FallbackFactory<CourseMarketService> {
    @Override
    public CourseMarketService create(Throwable throwable) {
        throwable.printStackTrace();
            return new CourseMarketService() {
                @Override
                public JsonResult get(Long id) {
                    return JsonResult.error(GlobalExceptionEnum.ERROR.getMessage(),GlobalExceptionEnum.ERROR.getCode());
                }
            };
        }
}
